package com.timoon.sample.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.timoon.sample.dao.ProductDAO;
import com.timoon.sample.dao.model.Product;
import com.timoon.sample.dao.model.ProductExample;
import com.timoon.sample.utils.SystemConfig;
import com.timoon.webcomponent.utility.product.rank.RankService;

/**
 *<p></p>
 *<p></p>
 *<p>Copyright:Copyright(c)2013</p>
 *<p>Company:timoon</p>
 *@author 付乐天
 *@version 1.0 */

@Service(value="com.timoon.sample.service.RankServiceImpl")
public class RankServiceImpl implements RankService {

	
	@Resource
	private ProductDAO productDAOImpl;
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Product> getRankProductList() {
		// TODO Auto-generated method stub
		
		List<Product> products=this.productDAOImpl.selectByExample(new ProductExample(){{
			this.createCriteria().andStatusNotEqualTo(0).andTypeEqualTo(SystemConfig.PRODUCT_TYPE_MAP.get("销售排行"));
		}});
		return products;
	}

	public ProductDAO getProductDAOImpl() {
		return productDAOImpl;
	}

	public void setProductDAOImpl(ProductDAO productDAOImpl) {
		this.productDAOImpl = productDAOImpl;
	}

}
